Skip to content

license: allow grouping of licenses with AND or OR clauses#2050

Open
sil2100 wants to merge 5 commits intochainguard-dev:mainfrom
sil2100:license-relations
Open

license: allow grouping of licenses with AND or OR clauses#2050
sil2100 wants to merge 5 commits intochainguard-dev:mainfrom
sil2100:license-relations

Conversation

@sil2100
Copy link
Member

@sil2100 sil2100 commented Jun 17, 2025

The world of licensing is complex. Some software is dual-licensed, some requires following multiple licenses. Let's add the ability to group licenses by AND and OR groupings. This is all optional.
Adds support for groupings in the rennovator. Now calling melange license-check --fix --structured package.yaml will attempt in creating a structured grouped license list.

sil2100 added 4 commits June 17, 2025 12:43
Signed-off-by: Łukasz 'sil2100' Zemczak <lukasz.zemczak@chainguard.dev>
Signed-off-by: Łukasz 'sil2100' Zemczak <lukasz.zemczak@chainguard.dev>
Signed-off-by: Łukasz 'sil2100' Zemczak <lukasz.zemczak@chainguard.dev>
@sil2100 sil2100 marked this pull request as ready for review June 18, 2025 12:40
@sil2100
Copy link
Member Author

sil2100 commented Jun 18, 2025

I am still not sure if the naming isn't a bit confusing. I think it would help if instead of operator: AND|OR we'd have something more clear to mention the grouping. Maybe I'll just change operator to grouped-by?

Signed-off-by: Łukasz 'sil2100' Zemczak <lukasz.zemczak@chainguard.dev>
@sil2100
Copy link
Member Author

sil2100 commented Jun 18, 2025

Should we go more with something like this?

- group: multi-licensed
  licenses:
  - ...
- group: choose-your-license
  licenses:
  - ...

@dannf
Copy link
Contributor

dannf commented Jun 25, 2025

Should we go more with something like this?

- group: multi-licensed
  licenses:
  - ...
- group: choose-your-license
  licenses:
  - ...

Something like this somehow feels more natural:

licensing:
  - path:
    - "src/"
    - "include"
    license:
      - and:
        - or:
          - GPL-v2
          - Apache-2.0
      - BSD-3-Clause
  - path:
      - "third_party/"
     license:
      - "MIT/"

I'm sure there's bugs in that, but you get what i mean. It feels akin to the - if construct a lot of YAML uses.

@sil2100
Copy link
Member Author

sil2100 commented Jun 25, 2025

hm, this is possible, however still confusing to look at. And using a structure similar to mine allows to add attestations as part of each license file easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments